<?php

namespace App\V3\V3_2_6\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;
class StorageSpaceOrderModel extends Model
{


    use HasFactory;

    protected $table   = 'storage_space_order';
    protected $dateFormat = 'U';//这个时间字段被为被格式化为UNIX 时间戳的形式存储
    protected $fillable = ['buy_storage_space','order_sn','main_id','price','created_at','updated_at','status','out_order_sn','type','pay_time','pay_type'];

    const UNPAYSTATUS = 2;
    const PAYSTATUS = 1;
    //toArray 时间转换问题
    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
}
